#ifndef Scene_h
#define Scene_h

class Territoire;
class Point3D;
/**
 * Classe Camera
 */
class Camera
{
  public:

  Camera() : eyeX(0), eyeY(200), eyeZ(-1000.0), centerX(0), centerY(200), centerZ(0), upX(0), upY(-1.0), upZ(0) {}
   void resetToDefault()
   { 
      eyeX=0; eyeY=200.0; eyeZ=-1000.0;
      centerX=0; centerY=200.0; centerZ=0; 
      upX=0; upY=-1.0; upZ=0;
   }
  public:

   float eyeX, eyeY, eyeZ, centerX, centerY, centerZ, upX, upY, upZ;
};

/**
 * Classe memorisant la position de la souris
 */
class Mouse
{
  public:
   
  Mouse() : x(0), y(0) {}

  public:
   
   int x, y;
   
};

/**
 * Classe Perspective
 */
class Perspective
{
  public:
   Perspective() : fovy(80.0),aspect(1.0),zNear(0.1),zFar(2000.0) {}
   void setPerspective(float _fovy, float _aspect, float _zNear, float _zFar)
      {
         fovy=_fovy;
         aspect=_aspect;
         zNear=_zNear;
         zFar=_zFar;
      }
  public:
   float fovy,aspect,zNear,zFar;
};

class Animation
{
  public:
   enum TypeAnim { INTRO, SEA, CAM, FEU, NOMJOUEUR, DE, NTYPEANIM };
   bool state;
   int timer;
};
/**
 * Classe Scene
 */
class Scene
{

  public:
 
   Scene();
   void moveCam(int _x, int _y);
   void resetToDefault() { camera.resetToDefault(); }
   
   void drawSea();
   
   void drawFire();
   void setPositionFeu(Point3D* _position) { positionFeu=_position; }

   void drawDe();

   bool isFogEnabled() const { return fog; }
   void toggleFog() { fog=!fog; }
   
   void highlightTerritoire(Territoire * _territoire);
   Territoire* getTerritoireHighlighted() { return territoireHighlighted; }

   bool isAnimated();
   bool getAnimationState(Animation::TypeAnim _type) { return animations[_type].state; }
   int getTimerAnimation();
   void startAnimation(Animation::TypeAnim _type);
   void stopAnimation(Animation::TypeAnim _type);
   void toggleAnimationState(Animation::TypeAnim _type);

   static int animCameraCenterTo(void * center);
   static int animIntroduction(void *);
   static int animNomJoueur(void*);
   static int animFeu(void* _point);
   static int animDe(void*);

  protected:

   void initAnimations();
   void initSea();

  public:

   Camera camera;
   Mouse mouse;
   Perspective perspective;
   
  protected:
   Territoire* territoireHighlighted;
   Point3D* positionFeu;
   Animation animations[Animation::NTYPEANIM];
   bool fog;

};

#endif
